package org.adream.account.dao;

import java.util.List;

import org.adream.account.entity.Dream2020UserEntity;
import org.apache.ibatis.annotations.Param;

@BaseMybatisDao
public interface Dream2020UserDao {
	
	int addDream2020User(Dream2020UserEntity dream2020User);
	
	int updateDream2020User(Dream2020UserEntity dream2020User);
	
	//绑定盒子用于casid
	int bindDream2020UserCasId(Dream2020UserEntity dream2020User);
	
	//根据casid查询用户,若为多个,直接取id最小的那个
	Dream2020UserEntity queryDream2020UserByCasId(@Param("casid") String casid);
	
	//根据学校id,认证类型,角色id查询梦想中心主任(数据原因可能存在多个)
	List<Dream2020UserEntity> queryDirectorsBySchoolNumberAndTypeAndRleId(@Param("schoolNumber") String schoolNumber, @Param("type") int type, @Param("rleId") int rleId);
	
	Dream2020UserEntity queryDream2020UserByPhone(@Param("phone") String phone);
	
	List<Dream2020UserEntity> queryDream2020UsersByEmail(@Param("email") String email);
	
	Dream2020UserEntity queryDream2020UserCourseTimeNumByCasId(@Param("casid") String casid);
	
	//根据id更新用户昵称
	int updateDream2020UserNameById(@Param("name") String name, @Param("id") int id);
	
	Dream2020UserEntity queryDream2020UserSetUpCourseNumByCasId(@Param("casid") String casid, @Param("ts") Long ts);
}